/*
#include <stdlib.h>
#include <time.h>
#include <stdio.h>

#include <windows.h>
#include <WinBase.h>

void CreatRandomSequence();
int CreatARandomNumber(int seed);

void main()
{
    CreatRandomSequence();
}

void CreatRandomSequence()
{
    int num;
    int l,m,n,o;
    m=GetCurrentProcessId();//½ø³ÌID
    for(l=0;l<1024;l++)
    {
        num=CreatARandomNumber(m);
        //printf("%6d",num);
        for(o=0;o<8;o++)
        {
            printf("%d ",num%2);
            num=num/2;
        }
        printf("\n");
        if((l+1)%8==0)
            printf("\n");

        n=num%1000;
        Sleep(n);
        m=GetTickCount();
    }
}

int CreatARandomNumber(int seed)
{
    int RanNum;
    int n;
    srand(seed);
    RanNum=rand();
    return RanNum;
}
*/

#include <stdlib.h>
#include <time.h>
#include <stdio.h>

void GetARandomSequence();

void main ()
{
    GetARandomSequence();
}
void  GetARandomSequence()
{
    FILE *fp;
    char character;
    int count;

    if((fp=fopen("E://test.txt","rb"))==NULL)
    {
        printf("Open the random file failed\n");
        exit(0);
    }
    count=0;
    while((character=fgetc(fp))!=EOF )
    {
        if(isprint(character))
        {
            switch(character)
            {
            case 69:
                printf("1 ");
                count++;
                break;
            case 101:
                printf("1 ");
                count++;
                break;

            case 65:
                printf("1 ");
                count++;
                break;
            case 97:
                printf("1 ");
                count++;
                break;

            case 73:
                printf("1 ");
                count++;
                break;
            case 105:
                printf("1 ");
                count++;
                break;

            case 82:
                printf("1 ");
                count++;
                break;
            case 114:
                printf("1 ");
                count++;
                break;

            case 72:
                printf("1 ");
                count++;
                break;
            case 104:
                printf("1 ");
                count++;
                break;

            case 67:
                printf("1 ");
                count++;
                break;
            case 99:
                printf("1 ");
                count++;
                break;

            case 77:
                printf("1 ");
                count++;
                break;
            case 109:
                printf("1 ");
                count++;
                break;

            case 85:
                printf("1 ");
                count++;
                break;
            case 117:
                printf("1 ");
                count++;
                break;

            case 74:
                printf("1 ");
                count++;
                break;
            case 106:
                printf("1 ");
                count++;
                break;

            case 86:
                printf("1 ");
                count++;
                break;
            case 118:
                printf("1 ");
                count++;
                break;

            case 84:
                printf("0 ");
                count++;
                break;
            case 116:
                printf("0 ");
                count++;
                break;

            case 79:
                printf("0 ");
                count++;
                break;
            case 111:
                printf("0 ");
                count++;
                break;

            case 78:
                printf("0 ");
                count++;
                break;
            case 110:
                printf("0 ");
                count++;
                break;

            case 83:
                printf("0 ");
                count++;
                break;
            case 115:
                printf("0 ");
                count++;
                break;

            case 68:
                printf("0 ");
                count++;
                break;
            case 100:
                printf("0 ");
                count++;
                break;

            case 76:
                printf("0 ");
                count++;
                break;
            case 108:
                printf("0 ");
                count++;
                break;

            case 80:
                printf("0 ");
                count++;
                break;
            case 112:
                printf("0 ");
                count++;
                break;

            case 70:
                printf("0 ");
                count++;
                break;
            case 102:
                printf("0 ");
                count++;
                break;

            case 71:
                printf("0 ");
                count++;
                break;
            case 103:
                printf("0 ");
                count++;
                break;

            case 87:
                printf("0 ");
                count++;
                break;
            case 119:
                printf("0 ");
                count++;
                break;

            case 89:
                printf("0 ");
                count++;
                break;
            case 121:
                printf("0 ");
                count++;
                break;

            case 66:
                printf("0 ");
                count++;
                break;
            case 98:
                printf("0 ");
                count++;
                break;

            case 75:
                printf("0 ");
                count++;
                break;
            case 107:
                printf("0 ");
                count++;
                break;

            case 88:
                printf("0 ");
                count++;
                break;
            case 120:
                printf("0 ");
                count++;
                break;

            case 81:
                printf("0 ");
                count++;
                break;
            case 113:
                printf("0 ");
                count++;
                break;

            case 90:
                printf("0 ");
                count++;
                break;
            case 122:
                printf("0 ");
                count++;
                break;

            default:
                break;
            }
        }
    }
    fclose(fp);

}

